package com.allenkerr.queue2;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 小柯
 * @date 2018/3/20
 */
public class Main {

  public static void main(String[] args) throws Exception {
    ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring-redis-beans.xml");
    RedisQueue2<String> redisQueue = (RedisQueue2) context.getBean("jedisQueue");

//    redisQueue.pushToHead("test:app2");
//    Thread.sleep(15000);

    for (int i = 0; i < 100; i++) {
      redisQueue.pushFromHead("test:app" + i);
    }

    Thread.sleep(150 * 100);
    System.out.println("--------------- Sleep End ------------------");

    redisQueue.destroy();
  }

}
